Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

plugin_http_api_test - fix timing issue #10103

Merged
merged 1 commit into from
Mar 3, 2021
Merged

Conversation

victorj8
Copy link
Contributor

@victorj8 victorj8 commented Mar 3, 2021

Consider the following scenario:

The overall plan is to activate a total of 17 protocol features.

  • The first 5 protocol features are activated and added to some block (let's say block 18).
  • While still on block 18, the remaining 12 protocol features transactions are executed (and they will be added to block 19, and the features will be active on block 20), and the check for waitForHeadToAdvance also gets executed while we are still on this block 18.
  • When the chain advances to block 19, the waitForHeadToAdvance method returns, but only 5 protocol features are really activated, leading to a state on the chain where we return from this method, but the protocol features are in realityy still not activated, leading to some failure on some further asserts that assume that this is the case after we return from preactivateAllBuiltinProtocolFeature.

Solution:

To handle this edge case, we wait 2 blocks, instead of 1, to make sure that all the transactions for protocol feature activations are executed and activated, also modify the timeout of the check for head advance to be proportional to the number of blocks we want to wait to advance.

Change Description

Change Type

Select ONE:

  • Documentation
  • Stability bug fix
  • Other
  • Other - special case

Testing Changes

Select ANY that apply:

  • New Tests
  • Existing Tests
  • Test Framework
  • CI System
  • Other

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants